Skip to content

Conversation

@TechLord22
Copy link
Member

@TechLord22 TechLord22 commented May 16, 2025

What

Reallocates MTE IDs to give us more room to fit things which previously were out of order.

As a result, all variants of energy, item, and fluid hatches are registered for all tiers, and recipes were given to them. Additionally, all machines doing sub-items ordering no longer do so.

MTE registration was moved into a dedicated class to reduce IDE strain when opening the MetaTileEntities class.

All old MTE IDs are datafixed to their new ones.

Outcome

Gives us much more space to add MTEs for the base mod in an organized order.

Potential Compatibility Issues

Everything should migrate over as expected.

@TechLord22 TechLord22 requested a review from a team as a code owner May 16, 2025 03:51
@TechLord22 TechLord22 added the type: feature New feature or request label May 16, 2025
MetaTileEntities.registerSimpleMetaTileEntity(MetaTileEntities.PACKER, 500, "packer", RecipeMaps.PACKER_RECIPES,
Textures.PACKER_OVERLAY, true);

// FREE, IDs 515-529
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we collapse this free space as well, and every other free space in the singleblocks?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Every ID that moves takes up more memory for every user of the mod permanently, since one cannot know in advance if migration is required until data is loaded that warrants it, and this does not only happen on initial world load either. You either encumber users with permanent memory usage increase or a permanent chunk loading performance overhead, memory is the better choice. I want to keep what we migrate to a minimum if possible.

I don't want to collapse any free space unnecessarily, especially when they are of a standard size. We can fill things in the gaps later when the time comes. Collapsing free space restricts us in the future because many of these gaps are intentionally placed to leave room for adding new things in order. This lets us keep all of the similar things together in jei instead of them being scattered around, or requiring the crazy getSubItems override hacks I removed in this PR to order them.


// Other single block machines

// Diesel Generator, IDs 935-949
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move the singleblock generators to start at 900?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my other comment.

new MetaTileEntityMultiFluidHatch(gregtechId("fluid_hatch.export_9x"), GTValues.EV, 9, true));
for (int i = GTValues.IV; i <= (GregTechAPI.isHighTier() ? GTValues.OpV : GTValues.UHV); i++) {
int index = i - GTValues.IV;
int startId = i > GTValues.UHV ? 1800 : 1780;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another place where high-tier components are located in the 1800 range, but not being migrated by the datafixer.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the IO hatch comment.

@TechLord22 TechLord22 merged commit 4fef8fb into master May 17, 2025
3 of 4 checks passed
@TechLord22 TechLord22 deleted the tc/id-realloc branch May 17, 2025 18:43
MrKono added a commit to GTModpackTeam/GregTech that referenced this pull request May 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants